package cn.edu.scau.cmi.zhangxiyang.client;

import java.net.URL;
import java.util.ResourceBundle;

import cn.edu.scau.cmi.zhangxiyang.interProgramming.*;
import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.TextArea;
import javafx.stage.Stage;

public class InterfaceProgrammingClient extends Application{
	/*public static void main(String args[]) {
		People people = new People();
		
		people.setStudent(new SoftwareEngineeringStudent());
		people.study();
	}*/
	
	public void start(Stage primaryStage) {
        try {
            Parent root = FXMLLoader.load(getClass().getClassLoader()
                    .getResource("cn/edu/scau/cmi/zhangxiyang/client/interface.fxml"));
            
            primaryStage.setTitle("接口模式");
            primaryStage.setScene(new Scene(root));
            primaryStage.show();

        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        launch(args);
    }
    
    public void initialize(URL location, ResourceBundle resources) {
	       // TODO (don't really need to do anything here).
	}
    
    @FXML
    private Button SStudent;
    
    @FXML
    private Button AStudent;
    
    @FXML
    private TextArea text;
    
    public void SStudnet_Click(ActionEvent event) {
    	People people = new People();
		people.setStudent(new SoftwareEngineeringStudent());
		String a = people.study();
		text.setText(a);
    }
    
    public void AStudnet_Click(ActionEvent event) {
    	People people = new People();
		people.setStudent(new ArtMajorStudent());
		String a = people.study();
		text.setText(a);
    }

}
